//
//  PlaceOrderViewController.m
//  AmountBody
//
//  Created by smm on 2017/12/5.
//  Copyright © 2017年 RCMTM. All rights reserved.
//

#import "PlaceOrderViewController.h"
#import "PlaceOrderTableViewCell.h"
#import "PlaceOrderHeaderCell.h"


static const CGFloat pickerViewH = 160;
static const CGFloat clearButtonH = 35;
static const CGFloat doneButtonH = USERDEFINED_TABBAR_H;

@interface PlaceOrderViewController ()<UITableViewDelegate,UITableViewDataSource,UIPickerViewDelegate,UIPickerViewDataSource,UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (weak, nonatomic) IBOutlet UIView *downView;
@property (weak, nonatomic) IBOutlet UIButton *submitButton;
- (IBAction)submitButton:(UIButton *)sender;
@property (weak, nonatomic) IBOutlet UIButton *addShoppCarButton;
- (IBAction)addShoppCarButton:(UIButton *)sender;
@property (weak, nonatomic) IBOutlet UIButton *orderListButton;

- (IBAction)orderListButton:(UIButton *)sender;
//弹出View
@property (strong, nonatomic) IBOutlet UIView *tanchuView;
@property (strong, nonatomic) IBOutlet UIPickerView *tanChuPickerView;
@property (strong, nonatomic) IBOutlet UIButton *doneButton;
@property (strong, nonatomic) IBOutlet UIButton *clearButton;
- (IBAction)doneButton:(id)sender;
- (IBAction)clearButton:(id)sender;

//
@property (weak, nonatomic) IBOutlet UIView * GYtanchuBackView;
@property (weak, nonatomic) IBOutlet UIImageView * GYtanchuImage;
@property (weak, nonatomic) IBOutlet UIView * first_GYtanchuView;
@property (weak, nonatomic) IBOutlet UIScrollView *f_scrollView;

@property (weak, nonatomic) IBOutlet UIView *next_GYtanchuView;
@property (weak, nonatomic) IBOutlet UIView *n_leftView;
@property (weak, nonatomic) IBOutlet UIView *n_lineView;
@property (weak, nonatomic) IBOutlet UIScrollView *n_scrollView;

@property (strong, nonatomic) PlaceOrderModel * model;//标记选中的Cell
@property (strong, nonatomic) PlaceOrderTypeModel * typeModel;
//数据
@property (strong, nonatomic) NSMutableArray * dataArray;

@end

@implementation PlaceOrderViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSString * name = GDLocalizedString(@"quick_order");
    self.title = name;
    self.view.backgroundColor = RGBColorAlpha(234, 234, 234, 1);
    
    self.public_headView.hidden = NO;
    self.public_headView.titleLabel = [self titleLabel];
    [self loadUI];
    [self loadGYtanchuView];
    _GYtanchuImage.hidden = YES;
    // Do any additional setup after loading the view.
}
-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    __weak __typeof(self)weakSelf = self;
    [PlaceOrderTableViewCell blockForSelectButton:^(PlaceOrderTypeModel *model) {
        __strong __typeof(weakSelf)strongSelf = weakSelf;
        if (strongSelf) {
            _typeModel = model;
            [self setUIForTanChuPickerView];
            [self.view bringSubviewToFront:_tanchuView];
            [UIView animateWithDuration:0.37 animations:^{
                _tanchuView.frame = CGRectMake(0, SCREEN_H-doneButtonH-clearButtonH-pickerViewH, SCREEN_W, clearButtonH+doneButtonH+pickerViewH);
                
            } completion:^(BOOL finished) {
                
            }];
        }
        
    }];
    [PlaceOrderTableViewCell blockForGYText:^(NSString *textStr, BOOL isShow) {
        __strong __typeof(weakSelf)strongSelf = weakSelf;
        if (strongSelf) {
            if (isShow) {
                [self loadGYtanchuView];
            }else{
                _GYtanchuImage.hidden = YES;
                
            }
        }
        
    }];
}
-(void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

-(void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
}

-(void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];
    
}

#pragma mark - 懒加载

- (NSMutableArray *)dataArray;
{
    if (!_dataArray) {
        _dataArray = [[NSMutableArray array]init];
    }
    return _dataArray;
}
#pragma mark - 竖屏适配
-(void)viewDidLayoutSubviews
{
    [self loadUI];
    [_tableView reloadData];
    [self setUIForTanChuPickerView];
}
#pragma mark -  UI布局
-(void)cancelFuc:(UITapGestureRecognizer*)tap
{
    if (_floatBlock) {
        _floatBlock(NO);
    }
}

-(void)loadUI
{
    UITapGestureRecognizer * cancelTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(cancelFuc:)];
    [self.view addGestureRecognizer:cancelTap];
    CGFloat downViewH = 60;
    _tableView.frame = CGRectMake(0, TOPNAVIGATIONBAR_H, SCREEN_W, SCREEN_H-TOPNAVIGATIONBAR_H-USERDEFINED_TABBAR_H-downViewH);
    _tableView.backgroundColor = RGBColorAlpha(234, 234, 234, 1);
    _downView.frame = CGRectMake(-1, SCREEN_H-USERDEFINED_TABBAR_H-downViewH, SCREEN_W+2, downViewH);
    [_downView setBianKuangAndColor:Line_color];
    
    CGFloat jianGeW = 25;
    CGFloat buttonW = 90;
    CGFloat buttonH = downViewH;
    [_orderListButton setTitle:@" 订单列表" forState:UIControlStateNormal];
    [_orderListButton setTitleColor:ZhongZi_Color forState:UIControlStateNormal];
    _orderListButton.titleLabel.font = Cell_Big_Font;
    [_orderListButton.titleLabel sizeToFit];
    [_orderListButton sizeToFit];
    _orderListButton.frame = CGRectMake(jianGeW, 0, _orderListButton.frame.size.width+10, buttonH);
    [_submitButton setTitle:@"提交订单" forState:UIControlStateNormal];
    [_submitButton setTitleColor:RGBColorAlpha(208, 63, 81, 1) forState:UIControlStateNormal];
    _submitButton.backgroundColor = RGBColorAlpha(44, 44, 44, 1);
    _submitButton.titleLabel.font = Cell_Big_Font;
    [_submitButton.titleLabel sizeToFit];
    [_submitButton sizeToFit];
    _submitButton.frame = CGRectMake(SCREEN_W-buttonW+1, 0, buttonW, buttonH);
    [_addShoppCarButton setTitle:@"加入购物车" forState:UIControlStateNormal];
    [_addShoppCarButton setTitleColor:ZhongZi_Color forState:UIControlStateNormal];
    _addShoppCarButton.backgroundColor = RGBColorAlpha(225, 225, 225, 1);
    _addShoppCarButton.titleLabel.font = Cell_Big_Font;
    [_addShoppCarButton.titleLabel sizeToFit];
    [_addShoppCarButton sizeToFit];
    _addShoppCarButton.frame = CGRectMake(SCREEN_W-buttonW*2+1, 0, buttonW, downViewH);
}
#pragma mark -- 类型弹出框

//类型弹出框
-(void)setUIForTanChuPickerView
{
    CGFloat buttonW = 120;
    CGFloat jianGeW = 30;
    _tanchuView.frame = CGRectMake(0, SCREEN_H, SCREEN_W, clearButtonH+doneButtonH+pickerViewH);
    _tanchuView.backgroundColor = Line_color;
    _clearButton.frame = CGRectMake(jianGeW, 0, buttonW, clearButtonH);
    [_clearButton setTitle:@"完成" forState:UIControlStateNormal];
    [_clearButton setTitleColor:ShenZi_Color forState:UIControlStateNormal];
    _clearButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
    //    _clearButton.backgroundColor = Line_color;
    _clearButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    _doneButton.frame = CGRectMake(SCREEN_W-jianGeW-buttonW, 0, buttonW, clearButtonH);
    [_doneButton setTitle:@"下一项" forState:UIControlStateNormal];
    [_doneButton setTitleColor:ShenZi_Color forState:UIControlStateNormal];
    _doneButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
    //    _doneButton.backgroundColor = Line_color;
    //使文字靠右
    _doneButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    _tanChuPickerView.frame = CGRectMake(0, clearButtonH, SCREEN_W, pickerViewH);
    _tanChuPickerView.backgroundColor = [UIColor whiteColor];
    _tanChuPickerView.delegate = self;
    _tanChuPickerView.dataSource = self;
    [_tanChuPickerView selectRow:0 inComponent:0 animated:YES];
    
    
}
#pragma mark -  工艺选择UI开始
-(void)loadGYtanchuView
{
    _GYtanchuImage.hidden = NO;
    _first_GYtanchuView.hidden = NO;
    _next_GYtanchuView.hidden = YES;
    CGFloat jianGeW = 18;
    CGFloat viewW = SCREEN_W/2.0-jianGeW;
    CGFloat viewH = 220;
    _GYtanchuImage.frame = CGRectMake(jianGeW, TOPNAVIGATIONBAR_H, viewW, viewH);
    CGFloat top = 20; // 顶端盖高度
    CGFloat bottom = 40 ; // 底端盖高度
    CGFloat left = 300; // 左端盖宽度
    CGFloat right = 20; // 右端盖宽度
    
    _GYtanchuImage.userInteractionEnabled = YES;
    UIImage * image = [UIImage imageNamed:@"gy_kuang"];
    // 指定为拉伸模式，伸缩后重新赋值
   image = [image stretchImageWithInsetsTop:top left:left bottom:bottom right:right];
    _GYtanchuImage.image = image;
    CGFloat l_jianGe = 10;
    _GYtanchuBackView.frame = CGRectMake(l_jianGe, l_jianGe*2, viewW-l_jianGe*2, viewH-l_jianGe-bottom);
    _first_GYtanchuView.frame = CGRectMake(0, 0, viewW-l_jianGe*2, viewH-l_jianGe-bottom);
    _f_scrollView.frame = CGRectMake(0, 0, _first_GYtanchuView.frame.size.width, _first_GYtanchuView.frame.size.height);
    [self loadUIForFirstScrollView];
    _next_GYtanchuView.frame = CGRectMake(0, 0, viewW-l_jianGe*2, viewH-l_jianGe-bottom);
    _n_leftView.frame = CGRectMake(0, 0, viewW-l_jianGe*2, viewH-l_jianGe-bottom);
    [self loadUIForNextLeftView];
    CGFloat jianGeH = 30;
    _n_lineView.frame = CGRectMake(viewW-1, jianGeH, 1, viewH-l_jianGe-bottom-jianGeH*2);
    _n_lineView.backgroundColor = Line_color;
    _n_scrollView.frame = CGRectMake(_n_lineView.frame.origin.x+_n_lineView.frame.size.width, 0, 0, viewH-l_jianGe-bottom);
    [_GYtanchuImage addSubview:_GYtanchuBackView];
}
static const CGFloat N_Text_Tag = 1600000;

-(void)loadUIForNextLeftView
{
    for (UIView * view in _n_leftView.subviews) {
        [view removeFromSuperview];
    }
    CGFloat viewW = _n_leftView.frame.size.width;
    CGFloat viewH = _n_leftView.frame.size.height;
    UILabel * label = [[UILabel alloc]init];
    label.text = @"0A03 设计风格：休闲软西服";
    label.textColor = ZhongZi_Color;
    label.font = Cell_Medium_Font;
    [label sizeToFit];
    label.frame = CGRectMake((viewW-label.frame.size.width)/2.0, 10, label.frame.size.width, Nomal_Label_H);
    [_n_leftView addSubview:label];
    CGFloat textW = 200;
    UITextField * text = [[UITextField alloc]initWithFrame:CGRectMake((viewW-textW)/2.0, 60, textW, Nomal_Label_H)];
    text.textColor = ZhongZi_Color;
    text.font = Cell_Medium_Font;
    text.delegate = self;
    text.tag = N_Text_Tag;
    
    [_n_leftView addSubview:text];
    UIView * lineView = [[UIView alloc]initWithFrame:CGRectMake((viewW-textW)/2.0, text.frame.origin.y+text.frame.size.height, textW, 1)];
    lineView.backgroundColor = Line_color;
    [_n_leftView addSubview:lineView];
    
}

static const CGFloat N_ScrollButton_Tag = 1200000;
-(void)loadUIForNextScrollView
{
    CGFloat jianGeW = 18;
    CGFloat viewW = SCREEN_W/2.0-jianGeW;
    CGFloat viewH = 220;
    CGFloat l_jianGe = 10;
    [UIView animateWithDuration:0.37 animations:^{
        _n_scrollView.frame = CGRectMake(_n_lineView.frame.origin.x+_n_lineView.frame.size.width, 0, _f_scrollView.frame.size.width, _f_scrollView.frame.size.height);
        _next_GYtanchuView.frame = CGRectMake(0, 0, viewW*2-l_jianGe*2, _next_GYtanchuView.frame.size.height);
        _GYtanchuBackView.frame = CGRectMake(_GYtanchuBackView.frame.origin.x, _GYtanchuBackView.frame.origin.y, viewW*2-l_jianGe*2, _GYtanchuBackView.frame.size.height);
        _GYtanchuImage.frame = CGRectMake(_GYtanchuImage.frame.origin.x, TOPNAVIGATIONBAR_H, viewW*2, viewH);
        
    }];
    for (UIView * view in _n_scrollView.subviews) {
        [view removeFromSuperview];
    }
    jianGeW = 10;
    viewW = _n_scrollView.frame.size.width-jianGeW*2;
    viewH = 35;
    
    NSArray * nameArray = [NSArray arrayWithObjects:@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服", nil];
    for (int i=0; i<nameArray.count; i++) {
        UIView * view = [[UIView alloc]initWithFrame:CGRectMake(jianGeW, viewH*i, viewW, viewH)];
        UIButton * button = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, viewW , viewH-1)];
        [button setTitle:[nameArray objectAtIndex:i] forState:UIControlStateNormal];
        button.tag = N_ScrollButton_Tag+i;
        [button setTitleColor:ZhongZi_Color forState:UIControlStateNormal];
        button.titleLabel.font = Cell_Medium_Font;
        [button addTarget:self action:@selector(nextScrollButtonFunc:) forControlEvents:UIControlEventTouchUpInside];
        UIView * lineView = [[UIView alloc]initWithFrame:CGRectMake(0, viewH-1, viewW, 1)];
        lineView.backgroundColor = Line_color;
        [view addSubview:lineView];
        [view addSubview:button];
        [_n_scrollView addSubview:view];
    }
    _n_scrollView.contentSize = CGSizeMake(_n_scrollView.frame.size.width, viewH*nameArray.count);
}

static const CGFloat F_ScrollButton_Tag = 1100000;
-(void)loadUIForFirstScrollView
{
    for (UIView * view in _f_scrollView.subviews) {
        [view removeFromSuperview];
    }
    CGFloat jianGeW = 10;
    CGFloat viewW = _f_scrollView.frame.size.width-jianGeW*2;
    CGFloat viewH = 35;
    
    NSArray * nameArray = [NSArray arrayWithObjects:@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服",@"0A03 设计风格：休闲软西服", nil];
    for (int i=0; i<nameArray.count; i++) {
        UIView * view = [[UIView alloc]initWithFrame:CGRectMake(jianGeW, viewH*i, viewW, viewH)];
        UIButton * button = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, viewW , viewH-1)];
        [button setTitle:[nameArray objectAtIndex:i] forState:UIControlStateNormal];
        button.tag = F_ScrollButton_Tag+i;
        [button setTitleColor:ZhongZi_Color forState:UIControlStateNormal];
        button.titleLabel.font = Cell_Medium_Font;
        [button addTarget:self action:@selector(firstScrollButtonFunc:) forControlEvents:UIControlEventTouchUpInside];
        UIView * lineView = [[UIView alloc]initWithFrame:CGRectMake(0, viewH-1, viewW, 1)];
        lineView.backgroundColor = Line_color;
        [view addSubview:lineView];
        [view addSubview:button];
        [_f_scrollView addSubview:view];
    }
    _f_scrollView.contentSize = CGSizeMake(_f_scrollView.frame.size.width, viewH*nameArray.count);
    
}
#pragma mark --  工艺选择UI结束
#pragma mark - textFeildDelegate
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    return YES;
}

- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
    return YES;
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string

{
    
    return YES;
    
}
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
    UITextField * text = [self.view viewWithTag:N_Text_Tag];
    if (textField.tag == N_Text_Tag || [text isFirstResponder]) {
        _GYtanchuImage.hidden = NO;
        [self loadUIForNextScrollView];
    }
}

-(BOOL)textFieldShouldEndEditing:(UITextField *)textField
{
   
    
    return YES;
}

#pragma mark - pickerview delegate & pickerview datasource
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView;
{
    return 1;
    
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
    
    return _typeModel.selectArr.count;
    
}

- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{
    UILabel* pickerLabel = (UILabel*)view;
    if (!pickerLabel){
        pickerLabel = [[UILabel alloc] init];
        // Setup label properties - frame, font, colors etc
        //adjustsFontSizeToFitWidth property to YES
        pickerLabel.adjustsFontSizeToFitWidth = YES;
        [pickerLabel setTextAlignment:NSTextAlignmentCenter];
        [pickerLabel setBackgroundColor:[UIColor clearColor]];
        [pickerLabel setFont:[UIFont systemFontOfSize:14]];
    }
    // Fill the label text here
    pickerLabel.text=[self pickerView:pickerView titleForRow:row forComponent:component];
    return pickerLabel;
}

- (NSString *)pickerView:(UIPickerView *)pickerView
             titleForRow:(NSInteger)row
            forComponent:(NSInteger)component
{
    TypeModel* model = [_typeModel.selectArr objectAtIndex:row];
    //    UITextField * text = [_YTJ_sOptionView viewWithTag:OptionText_Tag];
    //    text.text = GlobalHandleValue(model.name);
    return model.name;
}
-(NSString *)selectTitleWith:(NSInteger)row andDataArr:(NSArray *)arr{
    
    TypeModel* model = [_typeModel.selectArr objectAtIndex:row];
    
    return model.name;
    
}
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
    TypeModel* model = [_typeModel.selectArr objectAtIndex:row];
    
    UITextField * text = [_tableView viewWithTag:ChooseText_Tag+_typeModel.chooseType];
    text.text = GlobalHandleValue(model.name);
}


#pragma mark -- tableViewDelegate and dataSource
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
    
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 4;
}

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    
    PlaceOrderHeaderCell * nameView = [tableView dequeueReusableCellWithIdentifier:@"PlaceOrderHeaderCell"];
    NSArray * nameArray = [NSArray arrayWithObjects:@"产品信息",@"工艺信息",@"客户信息",@"量体信息", nil];
    [nameView setCellHeadWithName:[nameArray objectAtIndex:section]];
    nameView.frame = CGRectMake(0, 0, SCREEN_W, 65);
    nameView.backgroundColor = RGBColorAlpha(234, 234, 234, 1);
    return nameView;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 65;
}
static const CGFloat CellHeight = 360;

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    __block CGFloat height = 0;
    
    switch (indexPath.section) {
        case 0:
        {
            layoutViews(^{
                height = 160;
            }, ^{
                height = 200;
            });
            return height;
        }
            
            break;
        case 1:
        {
            layoutViews(^{
                height = 360;
            }, ^{
                height = 550;
            });
            return height;
        }
            break;
        case 2:
        {
            layoutViews(^{
                height = 250;
            }, ^{
                height = 310;
            });
            return height;
        }
            break;
        case 3:
            layoutViews(^{
                height = 550;
            }, ^{
                height = 780;
            });
            return height;
            break;
        default:
            return 0;
            break;
    }

}

-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
//    UITableViewCell * cell = [[UITableViewCell alloc]init];
    //    HomeCellModel * model = [_dataArray objectAtIndex:indexPath.row];
    PlaceOrderModel * model = [[PlaceOrderModel alloc]init];
    PlaceOrderTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"PlaceOrderTableViewCell"];
    cell.backgroundColor = RGBColorAlpha(234, 234, 234, 1);
    switch (indexPath.section) {
        case 0:
        {
            cell.type = PlaceOrderTypeForProductsNews;
            model.cell_H = 160;
            layoutViews(^{
                model.cell_H = 160;
            }, ^{
                model.cell_H = 200;
            });
            
        }
            break;
        case 1:
        {
            cell.type = PlaceOrderTypeForTechnologyNews;
            layoutViews(^{
                model.cell_H = 360;
            }, ^{
                model.cell_H = 550;
            });
        }
            break;
        case 2:
        {
            cell.type = PlaceOrderTypeForCustomerNews;
            model.cell_H = 250;
            layoutViews(^{
                model.cell_H = 250;
            }, ^{
                model.cell_H = 310;
            });
        }
            break;
        case 3:
        {
            cell.type = PlaceOrderTypeForAmountNews;
            layoutViews(^{
                model.cell_H = 550;
            }, ^{
                model.cell_H = 780;
            });
        }
            break;
        default:
            break;
    }
    [cell setCellWithModel:model];
    return cell;

    
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

#pragma mark -  手势按钮方法
-(void)firstScrollButtonFunc:(UIButton*)button
{
    _first_GYtanchuView.hidden = YES;
    _next_GYtanchuView.hidden = NO;
    
}
-(void)nextScrollButtonFunc:(UIButton*)button
{
    UITextField * text = [self.view viewWithTag:N_Text_Tag];
    [text resignFirstResponder];
    _GYtanchuImage.hidden = YES;
}
//弹出框button
- (IBAction)doneButton:(id)sender {//下一项
    _GYtanchuImage.hidden = YES;
    [UIView animateWithDuration:0.37 animations:^{
        _tanchuView.frame = CGRectMake(0, SCREEN_H, SCREEN_W, clearButtonH+doneButtonH+pickerViewH);
        
    } completion:^(BOOL finished) {
        
    }];
    
    
}

- (IBAction)clearButton:(id)sender {//完成
    _GYtanchuImage.hidden = YES;
    [UIView animateWithDuration:0.37 animations:^{
        _tanchuView.frame = CGRectMake(0, SCREEN_H, SCREEN_W, clearButtonH+doneButtonH+pickerViewH);
        
    } completion:^(BOOL finished) {
        
    }];
}

- (IBAction)submitButton:(UIButton *)sender {
}
- (IBAction)addShoppCarButton:(UIButton *)sender {
}
- (IBAction)orderListButton:(UIButton *)sender {
}


#pragma mark - block
static FloatViewBlock _floatBlock;
+(void)blockForFloatView:(FloatViewBlock)floatBlock
{
    _floatBlock = floatBlock;
}

@end
